package com.sdp.wx.db.wx_repair_must_item.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.core.bizc.db.IViewQuery;
import com.sdp.wx.db.wx_repair_must_item.entity.WxRepairMustItem;
import com.sdp.wx.db.wx_repair_must_item.mapper.WxRepairMustItemMapper;
import com.sdp.wx.db.wx_repair_must_item.service.IWxRepairMustItemService;
import com.sdp.wx.view.WxRepairMustItemView;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-02-19
 */
@Service
public class WxRepairMustItemServiceImpl extends ServiceImpl<WxRepairMustItemMapper, WxRepairMustItem> implements IWxRepairMustItemService,IViewQuery{

	
	@Autowired
	private WxRepairMustItemMapper wxRepairMustItemMapper;
	
	@Override
	public <T> List<T> viewList(QueryWrapper<T> queryWrapper) {
		// TODO Auto-generated method stub
		return wxRepairMustItemMapper.viewList(queryWrapper);
	}

	@Override
	public <T> int viewCount(QueryWrapper<T> queryWrapper) {
		// TODO Auto-generated method stub
		return wxRepairMustItemMapper.viewCount(queryWrapper);
	}

	@Override
	public <T> IPage<T> viewPage(IPage<T> page, QueryWrapper<T> queryWrapper) {
		// TODO Auto-generated method stub
		return wxRepairMustItemMapper.viewPage(page, queryWrapper);
	}

	@Override
	public List<WxRepairMustItem> queryRepairMustItemByRepairType(String repairType) {
		LambdaQueryWrapper<WxRepairMustItem> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxRepairMustItem::getRepairType, repairType);
		return list(queryWrapper);
	}

	@Override
	public List<WxRepairMustItemView> queryRepairMustItemViewByRepairType(String repairType) {
		QueryWrapper<WxRepairMustItemView> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("a.repair_type", repairType);
		return wxRepairMustItemMapper.viewList(queryWrapper);
	}

}
